'''
Created on Feb 23, 2011

@author: Bogdan Mata
'''

import random

articles = ["the", "a", "another"]
subjects = ["cat", "dog", "man", "woman"]
verbs = ["sang", "ran", "jumped"]
adverbs = ["loudly", "quietly", "well", "badly"]

lineNumber = 5
try:
    number = input("insert number of line, or Enter to continue: ")
    if number:
        number = int(number)
    if 0 < number < 11:
        lineNumber = number
    else:
        print("The number should be between 1 and 10")
except ValueError as err:
    print(err)

i = 0
while i < lineNumber:
    addAdverb = random.randint(0, 1)
    line = ""
    line += random.choice(articles)
    line += " " + random.choice(subjects)
    line += " " + random.choice(verbs)
    if addAdverb:
        line += " " + random.choice(adverbs)
    print(line)
    i += 1
